O.K. so now we have a wtcpue column here. Lets now get some data wrangling going and exploration figures
plot_data <- dat_exploded %>%
group_by(spp,year,lat,lon,depth) %>%
summarise_if(is_numeric,mean,na.rm=T) %>%
mutate(
year = as.numeric(year)
)
DeprecatedDeprecatedDeprecatedDeprecatedDeprecatedDeprecated
us_map <- st_as_sf(map("state", plot = FALSE, fill = TRUE))
path_world <- MyFunctions::my_path("G", extra_path = "Spatial/SAU/SAU_Shapefile")
path_world <- "~/Downloads/SAU_Shapefile"
# The File
fnam_world <- "SAUEEZ_July2015.shp"
# Load it!
World_eez_sf <- st_read(dsn = path_world,
layer =file_path_sans_ext(fnam_world)) %>%
rename(eez_name = Name) %>%
st_transform(crs = 4326) %>% # 4326
# st_transform(crs = "+proj=eck4") %>% # for tbular plot
st_simplify(preserveTopology = TRUE, dTolerance = 0.1) %>%
filter(eez_name == "USA (East Coast)")
# Set manual breaks for bins
bins <- seq(1970,2020,5)
map_data <- dat_exploded %>%
group_by(spp,year,lat,lon,depth) %>%
summarise_if(is_numeric,mean,na.rm=T) %>%
mutate(
year = as.numeric(year),
period = cut(year, breaks = bins)
) %>%
group_by(period,lat,lon) %>%
summarise_if(is.numeric,mean,na.rm=T) %>%
filter(wtcpue>0)
In this case the color gradiant represents year from 1972 to 2019
This is a simple 2d kenell analysis using ggplot2::stat_density_2d() of the sampling points
Looks to me that the stock might not be shifting per se but expanding its northern range
ggplot(us_map) +
geom_sf() +
geom_sf(data = World_eez_sf, aes(), fill = "white") +
geom_point(data = subset(map_data, wtcpue < 100),
aes(
x = lon,
y = lat,
color = wtcpue
),
) +
# facet_wrap(~period,
# nrow = 2) +
scale_color_distiller(palette = "Spectral",
guide_legend(title = "CPUE")) +
# viridis::scale_fill_viridis() +
# viridis::scale_colour_viridis() +
coord_sf(xlim = c(-76, -65),ylim = c(35, 45)) +
MyFunctions::my_ggtheme_m()
)
Error: unexpected ')' in ")"
This is the data extracted directly from NOAA in has four available surveys (OceanAdapt only two)
Northeast Fisheries Science Center (NEFSC) Fall Bottom Trawl Survey
Northeast Fisheries Science Center (NEFSC) Spring Bottom Trawl Survey
Northeast Fisheries Science Center (NEFSC) Summer Bottom Trawl Survey
Northeast Fisheries Science Center (NEFSC) Winter Bottom Trawl Survey
Black seabass code is 141